/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package telebim;


import java.awt.Dimension;
import java.awt.Font;
import javax.swing.JComponent;
import javax.swing.JLabel;

/**
 *
 * @author mejcu
 */
public class Label extends JComponent {

    Font title=new Font("Serif",Font.PLAIN,14);
    Font value=new Font("Serif",Font.BOLD,16);

    private JLabel playerName;
    private JLabel life;
    private JLabel playerNameValue;
    private JLabel lifeValue;

    /**
     *
     * @param name
     * @param _life
     */
    public Label(String name, int _life)
{
    playerName=new JLabel("Player:", JLabel.LEFT);
    playerName.setFont(title);
    life=new JLabel("Life:", JLabel.LEFT);
    life.setFont(title);
    playerNameValue=new JLabel(name, JLabel.RIGHT);
    playerNameValue.setFont(value);
    lifeValue=new JLabel(""+_life, JLabel.RIGHT);
    lifeValue.setFont(value);
}

    /**
     * 
     * @return
     */
    public Dimension getPrefferefSize()
{
    return new Dimension(120, 40);
}

/**
 *
 * @param name
 */
public void changePlayerName(String name)
{
    this.playerNameValue.setText(name);
}

/**
 *
 * @param state
 */
public void changePlayerLife(int state)
{
    this.lifeValue.setText(""+state);
}

/**
 *
 * @return
 */
public JLabel getPlayerName()
{
    return playerName;
}

/**
 *
 * @return
 */
public JLabel getPlayerNameValue()
{
    return playerNameValue;
}

/**
 *
 * @return
 */
public JLabel getLife()
{
    return life;
}

/**
 *
 * @return
 */
public JLabel getLifeValue()
{
    return lifeValue;
}

}

